<?php
namespace app\controllers;
use yii\web\Controller;
use Yii;

class TellController extends Controller
{
    public function actionIndex()
    {
        return $this->render("index");//跳转index
    }
    public function actionLogin()
    {
        $tell=$_POST['kong'];//接收值
        $yzm=$_POST['yzm'];

        $redis=new \Redis();//实劣化redis
        $redis->pconnect("127.0.0.1",6379);//传递数据
        $data=$redis->hGet("phone",$tell);//获取数据
        if($data==$yzm)//验证 验证码是否一致
        {
            echo "验证成功";
        }
        else
        {
            echo "验证失败";
        }
    }
}
?>